{extend name="sitehome@style/base"/}
{block name="resources"}
<style type="text/css">
    .dis{display: {if condition = "$parent eq 0"}none{else /} block{/if};}
</style>
{/block}
{block name="main"}
<div class="layui-form">
    <div class="layui-form-item">
        <label class="layui-form-label"><span class="required">*</span>分类</label>
        <div class="layui-input-inline nc-len-short">
            <select name="parent" lay-verify="parent" lay-filter="parent">
                <option value="0">父级分类</option>
                {volist name="$one_category_list" id="vo"}
                    <option value="{$vo.category_id}" {if $parent == $vo.category_id }selected="selected"{/if}>{$vo.name}</option>
                {/volist}
            </select>
        </div>
    </div>

    <div class="layui-form-item">
        <label class="layui-form-label"><span class="required">*</span>名称</label>
        <div class="layui-input-inline">
            <input type="text" name="name" lay-verify="name" placeholder="请输入名称" autocomplete="off" class="layui-input nc-len-long">
        </div>
    </div>
    
    <div class="layui-form-item">
        <label class="layui-form-label"><span class="required">*</span>排序</label>
        <div class="layui-input-inline">
            <input type="number" name="sort" lay-verify="sort" placeholder="排序" autocomplete="off" class="layui-input nc-len-tiny">
        </div>
    </div>
    <div class="layui-form-item">
        <label class="layui-form-label"><span class="required">*</span>是否显示</label>
        <div class="layui-input-inline">
            <input type="checkbox" required name="visible" value="1" checked lay-skin="switch" lay-filter="switch" >
        </div>
    </div>
    <div class="layui-form-item">
        <label class="layui-form-label">价格单位</label>
        <div class="layui-input-inline">
            <input type="text" name="price_unit" lay-verify="price_unit" placeholder="价格单位" autocomplete="off" class="layui-input nc-len-long">
        </div>
    </div>
    <div class="layui-form-item" >
        <label class="layui-form-label img-upload-lable">图标</label>
        <div  class="layui-input-inline article img-upload" id="layer-photos">
            <div>
                <input type="hidden" class="layui-input" name = "icon" value="" />
                <div class="upload-img-inline icon_img">
                    <div class="upload-img-box" onclick="uploadSingleicon_img()" >
                        <div>
                            <i class="add">+</i>
                        </div>
                    </div>
                </div>
                {:hook("fileUpload", ["name" => "icon_img", "file_type" => "IMAGE", "type" => "common"], '', true)}
            </div>
            <div style="clear: both"></div>
        </div>
    </div>

    <div class="layui-form-item dis" >
        <label class="layui-form-label">封面图片别名</label>
        <div class="layui-input-inline">
            <input type="text" name="icon_label" lay-verify="icon_label" placeholder="封面图片别名" autocomplete="off" class="layui-input nc-len-long">
        </div>
    </div>
    <div class="layui-form-item dis" >
        <label class="layui-form-label">标题别名</label>
        <div class="layui-input-inline">
            <input type="text" name="title_label" lay-verify="title_label" placeholder="标题别名" autocomplete="off" class="layui-input nc-len-long">
        </div>
    </div>
    <div class="layui-form-item dis" >
        <label class="layui-form-label">标题输入框提示</label>
        <div class="layui-input-inline">
            <input type="text" name="title_placeholder" lay-verify="title_placeholder" placeholder="标题输入框提示" autocomplete="off" class="layui-input nc-len-long">
        </div>
    </div>
    <div class="layui-form-item dis" >
        <label class="layui-form-label">详情别名</label>
        <div class="layui-input-inline">
            <input type="text" name="content_label" lay-verify="content_label" placeholder="详情别名" autocomplete="off" class="layui-input nc-len-long">
        </div>
    </div>
    <div class="layui-form-item dis" >
        <label class="layui-form-label">详情输入框提示</label>
        <div class="layui-input-inline">
            <input type="text" name="content_placeholder" lay-verify="content_placeholder" placeholder="详情输入框提示" autocomplete="off" class="layui-input nc-len-long">
        </div>
    </div>
    <div class="nc-form-row">
        <button class="layui-btn" lay-submit lay-filter="saveSms">保存</button>
        <button class="layui-btn layui-btn-primary" onclick="javascript:history.go(-1);">返回</button>
    </div>
</div>
{/block}
{block name="script"}
    <script>
        var url = "sns://sitehome/info/addCategory";
    </script>
    <script src="SNS_JS/category.js"></script>
{/block}